home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / TurboTCP 1.0.1 / Aliases / About box classes / CApplication.extra.cp < prev   
Encoding:
Text File  |  1993-11-02  |  1.2 KB  |  64 lines  |  [TEXT/KAHL]

  1. /*
  2. ** CAboutDialog.cp
  3. **
  4. **    About box library
  5. **    Extra code for your application subclass
  6. **
  7. **    Copyright © 1993, FrostByte Design / Eric Scouten
  8. **
  9. */
  10.  
  11.  
  12. // add the following lines to your DoCommand method
  13.  
  14. void C_AppName_App::DoCommand (long theCommand)
  15.  
  16. {
  17.     CAboutDirector *theAboutDirector = NULL;
  18.  
  19.     switch (theCommand) {
  20.  
  21.  
  22.         // handle “About _AppName_…”
  23.         
  24.         case cmdAbout:
  25.             theAboutDirector = new (CAboutDirector);
  26.             theAboutDirector->IAboutDirector(DLOGAboutBox, this);
  27.             theAboutDirector->DoAbout(FALSE, 0);
  28.             break;        
  29.  
  30.  
  31.         // insert other application-wide commands here
  32.  
  33.         default:
  34.             CApplication::DoCommand(theCommand);
  35.             break;
  36.     }
  37. }
  38.  
  39.  
  40. // add this method to provide a splash screen (omit it for no splash screen)
  41.  
  42. /*______________________________________________________________________
  43. **
  44. ** Run
  45. **
  46. **    Run the application. Overriden to provide splash screen.
  47. **
  48. */
  49.  
  50. void C_AppName_App::Run (void)
  51.  
  52. {
  53.     CAboutDirector *theAboutDirector = NULL;
  54.  
  55.  
  56.     // show a splash screen (modified about… box), then run the app
  57.     
  58.     theAboutDirector = new (CAboutDirector);
  59.     theAboutDirector->IAboutDirector(DLOGAboutBox, this);
  60.     theAboutDirector->DoAbout(TRUE, kSplashScreenTicks);
  61.  
  62.     CApplication::Run();
  63.  
  64. }